package com.xiang.sql;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.xiang.api.Util;
import com.xiang.sql.service.AddrService;
import com.xiang.sql.service.GoodsService;
import com.xiang.sql.service.GoodsTypeService;
import com.xiang.sql.service.GroupService;
import com.xiang.sql.service.MsgService;
import com.xiang.sql.service.OrderService;
import com.xiang.sql.service.OrderStockService;
import com.xiang.sql.service.PrizeService;
import com.xiang.sql.service.PrizeGroupService;
import com.xiang.sql.service.SettingService;
import com.xiang.sql.service.StockService;
import com.xiang.sql.service.StockLogService;
import com.xiang.sql.service.TaskService;
import com.xiang.sql.service.TransferService;
import com.xiang.sql.service.UploadService;
import com.xiang.sql.service.UserService;
import com.xiang.sql.service.VoucherService;

@Component
public class StaticService {

  public static <T> List<T> selectSql(String sql, Class<T> clazz) {
    return Util.toArray(Util.toJString(StaticSql.run.select(sql)), clazz);
  }

  public static AddrService addr;

  @Autowired
  public void setAddr(AddrService param) {
    addr = param;
  }

  public static GoodsService goods;

  @Autowired
  public void setGoods(GoodsService param) {
    goods = param;
  }

  public static GoodsTypeService goodsType;

  @Autowired
  public void setGoodsType(GoodsTypeService param) {
    goodsType = param;
  }

  public static GroupService group;

  @Autowired
  public void setGroup(GroupService param) {
    group = param;
  }

  public static MsgService msg;

  @Autowired
  public void setMsg(MsgService param) {
    msg = param;
  }

  public static OrderService order;

  @Autowired
  public void setOrder(OrderService param) {
    order = param;
  }

  public static OrderStockService orderStock;

  @Autowired
  public void setOrderStock(OrderStockService param) {
    orderStock = param;
  }

  public static PrizeService prize;

  @Autowired
  public void setPrize(PrizeService param) {
    prize = param;
  }

  public static PrizeGroupService prizeGroup;

  @Autowired
  public void setPrizeGroup(PrizeGroupService param) {
    prizeGroup = param;
  }

  public static SettingService setting;

  @Autowired
  public void setSetting(SettingService param) {
    setting = param;
  }

  public static StockService stock;

  @Autowired
  public void setStock(StockService param) {
    stock = param;
  }

  public static StockLogService stockLog;

  @Autowired
  public void setStockLog(StockLogService param) {
    stockLog = param;
  }

  public static TaskService task;

  @Autowired
  public void setTask(TaskService param) {
    task = param;
  }

  public static TransferService transfer;

  @Autowired
  public void setTransfer(TransferService param) {
    transfer = param;
  }

  public static UploadService upload;

  @Autowired
  public void setUpload(UploadService param) {
    upload = param;
  }

  public static UserService user;

  @Autowired
  public void setUser(UserService param) {
    user = param;
  }

  public static VoucherService voucher;

  @Autowired
  public void setVoucher(VoucherService param) {
    voucher = param;
  }
}